import 'package:aichat_flutter_wallet/module_common/utils/colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class AboutGasDialog {
  static showAboutGas(BuildContext context, {String chainName = 'BSC'}) {
    return showDialog(
        context: context,
        barrierDismissible: false,
        builder: (_) {
          return Dialog(
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(10.0.w),
            ),
            child: IntrinsicHeight(
              child: ClipRRect(
                borderRadius: BorderRadius.circular(10.0.w),
                child: Container(
                    padding: EdgeInsets.all(0),
                    decoration: BoxDecoration(
                        borderRadius: BorderRadius.all(
                          Radius.circular(20.w),
                        ),
                        color: AppColors.c_white),
                    child: Column(
                      children: [
                        SizedBox(
                          height: 20.w,
                        ),
                        Text(
                          'About Estimated Gas Fee',
                          style: TextStyle(
                              color: Color.fromRGBO(51, 51, 51, 1), fontWeight: FontWeight.w500, fontSize: 14.sp),
                        ),
                        SizedBox(
                          height: 10,
                        ),
                        Container(
                          padding: EdgeInsets.symmetric(horizontal: 20.w),
                          child: Text(
                            '''The estimated gas fee is calculated on the blockchain network conditions, once the transaction is confirmed, the estimated gas fee cannot be refunded, regardless of the transaction's success. The estimated gas fee is charged by the $chainName network, Kai does not charge any fees.''',
                            style: TextStyle(
                                fontSize: 12.sp,
                                height: 17.w / 12.w,
                                color: Color.fromRGBO(134, 131, 145, 1),
                                fontWeight: FontWeight.w400),
                          ),
                        ),
                        SizedBox(
                          height: 20.w,
                        ),
                        InkWell(
                          onTap: () {
                            Navigator.pop(context);
                          },
                          child: Container(
                              height: 57.w,
                              width: double.infinity,
                              alignment: Alignment.center,
                              decoration: BoxDecoration(
                                  border: Border(
                                top: BorderSide(
                                  color: Color.fromRGBO(243, 242, 247, 1),
                                  width: 1.w,
                                ),
                              )),
                              child: Text(
                                'OK',
                                style: TextStyle(
                                    color: Color.fromRGBO(134, 103, 254, 1),
                                    fontSize: 14.sp,
                                    fontWeight: FontWeight.w500),
                              )),
                        )
                      ],
                    )),
              ),
            ),
          );
        });
  }
}
